package com.sahyadri.web.util.security;

import org.springframework.stereotype.Component;

import com.sahyadri.web.bean.User;

@Component
public class SecurityContextUserHolder implements UserHolder {

	@Override
	public User getUser() {
		return this.getLoggedInUser();
	}

	@Override
	public String getUserId() {
		return getUser().getUsername();
	}

	@Override
	public User getLoggedInUser() {
		return (User) UserCredentialUtils.getUserDetails();
	}

}
